<template>
  <div>
    <h2>Music</h2>
  </div>
</template>

<script>
export default {
  name: "Music",
  mounted() {
    console.log("Music--mounted");
  },
  beforeDestroy() {
    console.log("Music--beforeDestroy");
  },

  /* 
    activated:被 keep-alive 缓存的组件激活时调用。(组件初始渲染的时候也会执行)
  */
  activated() {
    console.log("Music---激活");
  },
  /* 
    deactivated:被 keep-alive 缓存的组件失活时调用
  */
  deactivated() {
    console.log("Music---失活");
  },
};
</script>

<style></style>
